"""
while True :
    mark = int(input("请输入成绩0-100:>"))
    if mark < 0 or mark > 100 :
        print('程序结束')
        break
    if mark < 60:
        print("不及格")
    elif 60 <= mark <= 79:
        print("中等")
    else:
        print("优秀")"""

"""sum = 0
for i in range (1,10):
    p = 1
    for j in range (1,i+1):
         p *= j
    sum +=p
print(sum)"""

"""n = int(input('请输入一个整数：'))
sum = 0
while n != 0:
    digit = n % 10
    n //= 10
    sum += digit
print(sum)"""

"""
sum = 0
i = 1
cut = 0
while sum < 1000:
    sum += i
    print(i, end=' ')
    cut += 1
    if cut % 20 == 0:
        print()
    i+=1
"""

sum = 0
p = 1
for i in range(1, 10):
    p = i * p
    sum += p
print(sum)

"""
for i in range(0,61):
    if(i*2) + (60-i)*4==180:
        print("%d只鸡 %d兔子"%(i,60-i))
"""

"""
n = int(input("请输入金字塔层数:"))
for i in range(0,n):
    print(i*' ',end='')
    print((2*(n-1)+1)*'*')
    n-=1


"""

n = int(input("请输入层数:"))
for i in range(0, n // 2):
    print(((n // 2) - i) * ' ', end='')
    print((2 * i + 1) * '*')
for j in range(0, n - (n // 2)):
    print(j * ' ', end='')
    print((((n // 2) - j) * 2 + 1) * '*')

